home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr11 / powerb5.zip / P5DOS014.TIP < prev    next >
Text File  |  1993-06-01  |  2KB  |  53 lines

  1. I recently needed about a dozen randomized name lists in
  2. order to assign students to groups. It occurred to me that
  3. the DOS SORT routine had the ability to sort lists in
  4. seemingly random fashion. Ordinarily, you would use the
  5. command SORT < NAMES.DAT to sort the lines in the file
  6. NAMES.DAT in the usual fashion, by first character. However,
  7. if one uses the /+n extension, sorting will begin with
  8. column n of each line. Thus, the (more or less) random
  9. characters in the names determine the ordering, giving a
  10. scrambled list.
  11.  
  12. For example, if the file NAMES.DAT contains the five lines:
  13.  
  14.      Arthur
  15.      Gilbert
  16.      Rachel
  17.      Robert
  18.      Susanne
  19.  
  20. the command SORT/+3 < NAMES.DAT displays:
  21.  
  22.      Robert
  23.      Rachel
  24.      Gilbert
  25.      Susanne
  26.      Arthur
  27.  
  28. The file containing the names (or any other words or lines
  29. to be scrambled) can be any ASCII file. First names, last
  30. names, and other information can also be included. Spaces
  31. and punctuation present no problem, because they have ASCII
  32. codes that DOS will use in sorting. The number of possible
  33. scrambled lists one can get depends only on the length of
  34. the lines one uses.
  35.  
  36. Lawrence Corrado
  37. Manitowoc, Wisconsin
  38.  
  39. Editor's Note: This is the first time I've ever heard of a
  40. sort utility being used to unsort names, but the idea is a
  41. good one. This technique can be used in almost any situation
  42. where groups of names must be chosen at random -- such as in
  43. simple games or while deciding on promotions within your
  44. organization.
  45.  
  46.  
  47. Title: Using SORT to Unsort
  48. Category: DOS
  49. Issue Date: December, 1992
  50. Editor: Brett Glass
  51. Supplementary Files: None
  52. Filename: P5DOS014.TIP
  53.